package com.haohan.jingyuan.customer.helper;

import com.haohan.jingyuan.customer.dto.resp.GroupInfoResp;
import com.haohan.jingyuan.customer.entity.CustomerGroupInfo;

/**
 * 分组响应对象转换工具类
 * 
 * @ClassName GroupRespHelper
 * @Description 分组响应对象转换工具
 * @Author hexijun
 * @Time 2025/01/19 20:00
 * @Version 1.0
 */
public class GroupRespHelper {

    /**
     * 将分组实体转换为分组信息响应对象
     * 
     * @param customerGroupInfo 分组实体
     * @return 分组信息响应对象
     */
    public static GroupInfoResp convert2GroupInfoResp(CustomerGroupInfo customerGroupInfo) {
        if (customerGroupInfo == null) {
            return null;
        }

        GroupInfoResp groupInfoResp = new GroupInfoResp();
        groupInfoResp.setId(customerGroupInfo.getId());
        groupInfoResp.setGroupId(customerGroupInfo.getGroupId());
        groupInfoResp.setGroupName(customerGroupInfo.getGroupName());
        groupInfoResp.setType(customerGroupInfo.getType());
        groupInfoResp.setParentGroupId(customerGroupInfo.getParentGroupId());
        groupInfoResp.setDescription(customerGroupInfo.getDescription());
        groupInfoResp.setUkid(customerGroupInfo.getUkid());
        groupInfoResp.setCreator(customerGroupInfo.getCreator());
        groupInfoResp.setGmtCreated(customerGroupInfo.getGmtCreated());
        groupInfoResp.setModifier(customerGroupInfo.getModifier());
        groupInfoResp.setGmtModified(customerGroupInfo.getGmtModified());
        groupInfoResp.setIsDeleted(customerGroupInfo.getIsDeleted());

        return groupInfoResp;
    }
}
